/***********************************************************************
 *
 * Copyright (C) 2009 Graeme Gott <graeme@gottcode.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 ***********************************************************************/

#ifndef WINDOW_H
#define WINDOW_H

#include "ui_mainwnd.h"
#include <QMainWindow>
#include <QHttp>
#include <QUrl>

struct rsscontent {
// RSS feed description
    QString feed_title;
    QString feed_link;
    QString feed_author;
    QString feed_desc;
    QString feed_type;
//---
    QStringList title;
    QStringList link;
    QStringList author;
    QStringList date;
    QStringList snippet;
    QStringList text;
    QStringList categories;
    int count;
};

class Window : public QMainWindow, public Ui::MainWindow {
	Q_OBJECT
public:
        Window(QWidget *parent, Qt::WFlags f);

/*protected:
	virtual void closeEvent(QCloseEvent* event);
        virtual void keyPressEvent(QKeyEvent* event);*/

private slots:
/*	void about();*/
        void requestDone(bool);

private:
        QHttp* m_Http;
        bool parseRSSFood(QString data, rsscontent* out);
        void sendRequest(QString feedUrl);
        void printRSS(QString);
};

#endif
